﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SessionHunter.Model
{
    /// <summary>
    /// A representation of a single item in session
    /// </summary>
    [Serializable]
    public class SessionItem
    {
        /// <summary>
        /// Gets or sets the session key.
        /// </summary>
        /// <value>
        /// The key.
        /// </value>
        public string Key { get; set; }
        /// <summary>
        /// Gets or sets the item.
        /// </summary>
        /// <value>
        /// A copy of the item in session
        /// </value>
        public object Item { get; set; }
        /// <summary>
        /// Gets or sets the type of the item from session.
        /// </summary>
        /// <value>
        /// The type of the item to display.
        /// </value>
        public string ShortTypeName { get; set; }
        /// <summary>
        /// Gets or sets the size in KB.
        /// </summary>
        /// <value>
        /// The size.
        /// </value>
        public decimal Size { get; set; }
        /// <summary>
        /// If there is an error with retrieving the item, the message is here
        /// </summary>
        public string ErrorMessage { get; set; }

        /// <summary>
        /// Gets the string we display on screen
        /// </summary>
        public string DisplayKey
        {
            get
            {
                return Key + " (" + ShortTypeName + ")";
            }
        }
    }
}
